const mongoose=require('./db')

const hotelSchema=mongoose.Schema({
    img:String,
    name:String,
    address:String,
    price:String,
    phone:String,
    type:String,
    space:String,
    star:String,
    flag:{
        type:Boolean,
        befault:false
    },
    roomid:{
        type:[mongoose.Types.ObjectId],
        ref:'room'
    }
})

const roomSchema=new mongoose.Schema({
    name:String,
    price:Number
})

const  indentSchema=mongoose.Schema({
    jdname:String,
    rddress:String,
    fzname:String,
    price:String,
    da:String,
    db:String,
    num:String,
    nights:String,
    name:String,
    phone:String,
    type:String
})

const hotelModel=mongoose.model('hotel',hotelSchema,'hotel')
const roomModel=mongoose.model('room',roomSchema,'room')
const indentModel=mongoose.model('indent',indentSchema,'indent')

module.exports={
    hotelModel,roomModel,indentModel
}